<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>统一地图平台</title><link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    <style>
        html,
        body,
        #mapui {
            margin: 0 auto;
            width: 100%;
            height: 100%
        }

        html,
        body {
            margin: 0;
            overflow: hidden;
            background: #fff;
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
        }
    </style>

</head>

<body>
    <div id="mapui"></div>

    <script src="./js_thematic_map_example/script/jq/jquery.min.js"></script>
    <script src="./js_example/script/map.min.js"></script>
    <script src="./js_example/script/demo.js"></script>
    
    <script>
        var echartsLayer = null;
        var option = null;
        var amap = null;
        var that = this;

        var uploadedDataURL = "./js_thematic_map_example/data/changchunBus.json";

        $.get(uploadedDataURL, function (data) {
            option = {
                animation: false,
                GLMap: {
                    roam: true
                },
                coordinateSystem: 'GLMap',
                geo: {
                    map: 'GLMap',
                },

                series: [{
                    type: 'lines',
                    polyline: true,
                    data: data,
                    silent: true,
                    lineStyle: {
                        normal: {
                            opacity: 0.2,
                            width: 1,
                        }
                    },
                    progressiveThreshold: 500,
                    progressive: 100,
                }, {

                    type: 'lines',
                    coordinateSystem: 'GLMap',
                    polyline: true,
                    data: data,
                    lineStyle: {
                        normal: {
                            width: 0.2
                        }
                    },
                    effect: {
                        constantSpeed: 40,
                        show: true,
                        trailLength: 0.02,
                        symbolSize: 2
                    },
                }]
            };


            map.Factory.create('mapui', {
                style:style,
                center: [125.35, 43.86],
                fullExtent: {
                    xmin: 90.992204,
                    ymin: 10.979711,
                    xmax: 120.5338915,
                    ymax: 50.543712
                },
                zoom: 10,
                projection: 'EPSG:4326',
                strategy: ['mapboxgl', 'openlayers']
            }, (o) => {
                amap = o;
                map.Factory.loadSpecialMap('echarts', () => {
                that.init(amap.pmap);
            })
            });
        });

        function init(map) {
            echartsLayer = new EchartsLayer(map);
            echartsLayer.chart.setOption(option);
        }



    </script>
</body>

</html>